// pages/resumeOthers/resumeOthers.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrls: [
      'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640',
      'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=640',
      'https://images.unsplash.com/photo-1551446591-142875a901a1?w=640'
    ],
    indicatorDots: false,
    autoplay: false,
    interval: 5000,
    duration: 1000,
    phoneNumber: '15802797911',
    email: 'someone000@126.com',
    wechat: 'festone',
    qq: '451682479',
    blog: 'http://blog.csdn.net/festone000',
    gitee: 'https://gitee.com/festone',
    github: 'https://github.com/festone000',
    codingnet: 'https://coding.net/u/ZHA0s'
  },
  //拨打电话
  makePhoneCall: function() {
    var self = this;
    wx.showActionSheet({
      itemList: [self.data.phoneNumber],
      success: function(res) {
        wx.makePhoneCall({
          phoneNumber: self.data.phoneNumber,
          success: function() {
            console.log("拨打电话成功！")
          },
          fail: function() {
            console.log("拨打电话失败！")
          }
        })
        if (!res.cancel) {
          console.log(res.tapIndex) //console出了下标
        }
      }
    });
  },
  //复制号码、地址
  copyText: function(event) {
    var self = this;
    var type = event.target.dataset.type; // 1 2 3 4 5..
    var urlArr = [self.data.email, self.data.wechat, self.data.qq, self.data.blog, self.data.gitee, self.data.github, self.data.codingnet];
    wx.setClipboardData({
      //准备复制的数据
      data: urlArr[type - 1],
      success: function(res) {
        wx.showToast({
          title: '复制成功',
        });
      }
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  },
  gotoIndexPage: function() {
    wx.navigateTo({
      url: '/pages/resumeIndex/resumeIndex',
      success: function() {
        console.log('success');
      },
      fail: function() {
        console.log('fail');
      },
      complete: function() {
        console.log('complete');
      }
    });
  }
})